package com.jk.smartelderlycare.controller;

import com.jk.smartelderlycare.dto.SysPlay;
import com.jk.smartelderlycare.interfaces.SysplayServiceApi;
import com.jk.smartelderlycare.pojo.PagedResponse;
import com.jk.smartelderlycare.service.SysPlayService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author hhk
 * @version 1.0
 * @ClassName SysPlayController
 * @program: smart-elderly-care
 * @description: TODO
 * @date 2024/11/15 13:30
 */
@RestController
@Slf4j
public class SysPlayController implements SysplayServiceApi {
    @Autowired
    private SysPlayService sysPlayService;
    /**
     * @description: 后端分页查询
     * @param: [sysPlay, pageNum, pageSize]
     * @return: com.jk.smartelderlycare.pojo.PagedResponse<com.jk.smartelderlycare.dto.SysPlay>
     * @author hhk
     * @date: 2024/11/15 13:31
     */
    @Override
    public PagedResponse<SysPlay> findSysPlayPaginationList(SysPlay sysPlay, Integer pageNum, Integer pageSize) {
        return sysPlayService.findSysPlayPaginationList(sysPlay,pageNum,pageSize);
    }
    /**
     * @description: 新增
     * @param: [sysPlay]
     * @return: void
     * @author hhk
     * @date: 2024/11/15 13:31
     */
    @Override
    public void addSysPlay(SysPlay sysPlay) {
        sysPlayService.addSysPlay(sysPlay);
    }
    /**
     * @description: 根据id删除
     * @param: [playId]
     * @return: void
     * @author hhk
     * @date: 2024/11/15 13:31
     */
    @Override
    public void deleteSysPlayById(Long playId) {
        sysPlayService.deleteSysPlayById(playId);
    }
    /**
     * @description: 根据id回显
     * @param: [playId]
     * @return: void
     * @author hhk
     * @date: 2024/11/15 13:32
     */
    @Override
    public SysPlay findSysPlayById(Long playId) {
       return sysPlayService.findSysPlayById(playId);
    }
    /**
     * @description: 修改
     * @param: [sysPlay]
     * @return: void
     * @author hhk
     * @date: 2024/11/15 13:32
     */
    @Override
    public void updateSysPlay(SysPlay sysPlay) {
        sysPlayService.updateSysPlay(sysPlay);
    }
    /**
     * @description: 批量修改
     * @param: [ids]
     * @return: void
     * @author hhk
     * @date: 2024/11/15 13:47
     */
    @Override
    public void deleteSysPlayByIds(List<Long> ids) {
        sysPlayService.deleteSysPlayByIds(ids);
    }
}
